One of the things that separate the mail back ends from the
rest of the back ends is the heavy dependence by most of the mail
back ends on common functions in nnmail.el. For instance, here's the
definition of nnml-request-scan:
(deffoo nnml-request-scan (&optional group server)
(setq nnml-article-file-alist nil)
(nnmail-get-new-mail 'nnml 'nnml-save-nov nnml-directory group))
It simply calls nnmail-get-new-mail with a few
parameters, and nnmail takes care of all the moving
and splitting of the mail.
This function takes four parameters.
nnmail-get-new-mail will call
back-end-save-mail to save each article.
back-end-active-number will be called to
find the article number assigned to this article.
The function also uses the following variables:
back-end-get-new-mail (to see whether to
get new mail for this back end); and
back-end-group-alist and
back-end-active-file to generate the new
active file. back-end-group-alist should
be a group-active alist, like this:
(("a-group" (1 . 10))
("some-group" (34 . 39)))